﻿using System;
using System.Collections.Generic;

namespace DflyingForum.Core.Data.Domain.Entities
{
    /// <summary>
    /// 论坛帖子
    /// </summary>
    public class Posts : EntityBase
    {
        private IList<Reply> _replys;

        private IList<PostState> _postStates;

        public virtual string Subject { get; set; }

        public virtual string Body { get; set; }

        public virtual User PubUser { get; set; }

        public virtual Module Module { get; set; }

        public virtual DateTime LastEditTime { get; set; }

        public virtual int LastEditUserID { get; set; }//不映射

        public virtual int Hits { get; set; }

        /// <summary>
        /// 冗余字段，是否提前
        /// </summary>
        public virtual bool IsTop { get; set; }

        public virtual Topic Topic { get; set; }
        /// <summary>
        /// 回复总数,还可以用来排序
        /// </summary>
        public virtual int ReplyCount { get; set; }

        public virtual int LastReplyUserID { get; set; }

        public virtual int LastReplyID { get; set; }

        /// <summary>
        /// 排序字段
        /// </summary>
        public virtual int Sort { get; set; }

        public virtual IList<Reply> Replys
        {
            get { return _replys; }
            set { _replys = value; }
        }

        public virtual IList<PostState> PostStates
        {
            get { return _postStates; }
            set { _postStates = value; }
        }

        public Posts()
        {
            _replys = new List<Reply>();
            _postStates = new List<PostState>();
        }

    }
}
